package com.zx.cloud.domain.enums;

import com.zx.cloud.common.mybatis.handler.CodeEnum;

public enum ResourceStatus implements CodeEnum<ResourceStatus> {

	NOMAIL(0, "启用"), DELETE(1, "删除");

	private int code;
	private String desc;

	private ResourceStatus(int code, String desc) {
		this.code = code;
	}

	/**
     * 通过枚举<code>name</code>获取枚举
     */
    public static ResourceStatus getEnumByCode(Integer code) {
    	if(code==null){
    		return null;
    	}
        for (ResourceStatus enumm : ResourceStatus.values()) {
            if (enumm.getCode()==code.intValue()) {
                return enumm;
            }
        }
        return null;
    }
    
	@Override
	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

}

